package org.grow.basic.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.grow.basic.entity.*;

import java.util.List;

@Mapper
public interface ShoppingBillMapper extends BaseMapper<ShoppingBill> {
    int insertItems(@Param("items") List<ShoppingBillItem> shoppingBillItems);

    List<ShoppingBill> dynamicSubmit(@Param("qc") ShoppingSubmitQC shoppingSubmitQC
            , @Param("username") String username);

    IPage<ShoppingBill> dynamicSubmit(IPage<ShoppingBill> page, @Param("qc") ShoppingSubmitQC shoppingSubmitQC
            , @Param("username") String username);

    ShoppingBill selectDomainById(@Param("code") String code);

    ShoppingBill findByCode(@Param("code") String code);

    /**
     * 末尾ShoppingState参数 表示 排除的状态 一般是 toSubmit
     */
    List<ShoppingBill> dynamicAudit(@Param("qc") ShoppingAuditQC shoppingAuditQC,
                                    @Param("toSubmitState") ShoppingState toSubmitState);

    IPage<ShoppingBill> dynamicAudit(IPage<ShoppingBill> page,
                                     @Param("qc") ShoppingAuditQC shoppingAuditQC,
                                     @Param("toSubmitState") ShoppingState toSubmitState);
}